{% extends "bootstrap/base.html" %}

{% block title %}Exam{% endblock %}

{% block head %}
{{ super() }}
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.ico') }}" type="image/x-icon">
<link rel="icon" href="{{ url_for('static', filename='img/favicon.ico') }}" type="image/x-icon">
{% endblock %}

{% block navbar %}
<div class="navbar navbar-inverse" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{{ url_for('main.index') }}">Exam</a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">

                <li><a href="{{ url_for('main.index') }}">主页</a></li>

                <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                     aria-haspopup="true" aria-expanded="false">知识体系结构<span class="caret"></span></a>
                  <ul class="dropdown-menu">
                      {% for s in subject_results %}
                     <li><a href="{{ url_for('main.structure', subject=s.name) }}">{{s.name}}</a></li>
                     <li role="separator" class="divider"></li>
                     <!--<li><a href="{{ url_for('main.structure', subject='机器学习') }}">机器学习</a></li>-->
                     <!--<li role="separator" class="divider"></li>-->
                     <!--<li><a href="{{ url_for('main.structure', subject='算法分析') }}">算法分析</a></li>-->
                     <!--<li role="separator" class="divider"></li>-->
                     <!--<li><a href="{{ url_for('main.search', question_type_id='主观题') }}">主观题</a></li>-->
                      {% endfor %}
                  </ul>
                </li>
                <li><a href="{{ url_for('ques.examOnline') }}">在线测试</a></li>

              <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                     aria-haspopup="true" aria-expanded="false">题型 <span class="caret"></span></a>
                  <ul class="dropdown-menu">
                     <li><a href="{{ url_for('main.search', question_type_id='选择题') }}">选择题</a></li>
                     <li role="separator" class="divider"></li>
                     <li><a href="{{ url_for('main.search', question_type_id='填空题') }}">填空题</a></li>
                     <li role="separator" class="divider"></li>
                     <li><a href="{{ url_for('main.search', question_type_id='判断题') }}">判断题</a></li>
                     <!--<li role="separator" class="divider"></li>-->
                     <!--<li><a href="{{ url_for('main.search', question_type_id='主观题') }}">主观题</a></li>-->
                  </ul>
              </li>
              {% if current_user.role_id == 1 or  current_user.role_id == 3 %}
              <li><a href="{{ url_for('ques.organize') }}">在线组卷</a></li>

              <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                 aria-haspopup="true" aria-expanded="false">试题添加<span class="caret"></span></a>
                <ul class="dropdown-menu">
                 {% for s in subject_results %}
                 <li><a href="{{ url_for('main.structure', subject=s.name) }}">{{s.name}}</a></li>
                 <li role="separator" class="divider"></li>
                 <!--<li><a href="{{ url_for('main.structure', subject='机器学习') }}">机器学习</a></li>-->
                 <!--<li role="separator" class="divider"></li>-->
                 <!--<li><a href="{{ url_for('main.structure', subject='算法分析') }}">算法分析</a></li>-->
                 <!--<li role="separator" class="divider"></li>-->
                 <!--<li><a href="{{ url_for('main.search', question_type_id='主观题') }}">主观题</a></li>-->
                  {% endfor %}
                 <!--<li><a href="{{ url_for('ques.add', subject='数据结构') }}">数据结构</a></li>-->
                 <!--<li role="separator" class="divider"></li>-->
                 <!--<li><a href="{{ url_for('ques.add', subject='算法分析') }}">算法分析</a></li>-->
                 <!--<li role="separator" class="divider"></li>-->
                 <!--<li><a href="{{ url_for('ques.add', subject='机器学习') }}">机器学习</a></li>-->
                 <!--<li role="separator" class="divider"></li>-->
                 <!--<li><a href="{{ url_for('main.search', question_type_id='主观题') }}">主观题</a></li>-->
                </ul>
              </li>

              <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                 aria-haspopup="true" aria-expanded="false">学科添加 <span class="caret"></span></a>
                <ul class="dropdown-menu">
                 <li><a href="{{ url_for('ques.addSubject') }}">添加学科</a></li>
                 <li role="separator" class="divider"></li>
                 <li><a href="{{ url_for('ques.addChapter') }}">添加章节</a></li>
                 <li role="separator" class="divider"></li>
                 <li><a href="{{ url_for('ques.addKnPoints') }}">添加知识点</a></li>
                 <li role="separator" class="divider"></li>
                 <li><a href="{{ url_for('ques.upload') }}">题库上传</a></li>
                 <!--<li role="separator" class="divider"></li>-->
                 <!--<li><a href="{{ url_for('main.search', question_type_id='主观题') }}">主观题</a></li>-->
                </ul>
              </li>

              {% endif %}

              {% if current_user.role_id == 3 %}
              <li><a href="{{ url_for('main.organize_user') }}">用户管理</a></li>
              {% endif %}
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {% if current_user.is_authenticated %}
                <li><a href="/user/{{current_user.username}}">{{current_user.username}}</a></li>
                <li><a href="{{url_for('auth.logout')}}">登出</a></li>

                {% else %}
                <li><a href="{{url_for('auth.login')}}">登陆</a></li>
                {% endif %}
            </ul>
        </div>
    </div>
</div>
{% endblock %}

{% block content %}
<div class="container">
    {% for message in get_flashed_messages() %}
    <div class="alert alert-warning">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        {{ message }}
    </div>
    {% endfor %}

    {% block page_content %}{% endblock %}
</div>
{% endblock %}

{% block scripts %}
{{ super() }}
{{ moment.include_moment() }}
{% endblock %}
